import * as T from '../actionTypes/tab'
import { WindowSchema } from '@src/components/schema/window';
import { AuthoritySchema } from '@src/components/schema/authority';

// tab页面相关
export const addWindow = (data: WindowSchema) => ({ type: T.ADD_WINDOW, data }) // 新增窗口
export const delWindow = (data: string) => ({ type: T.DEL_WINDOW, data }) // 关闭窗口
export const modifyWindowMeta = (data: WindowSchema) => ({ type: T.MODIFY_WINDOW_META, data }) // 修改窗口元数据
export const setActiveWindowId = (data: string) => ({ type: T.SET_ACTIVE_WINDOW_ID, data }) // 设置当前窗
export const initMenuList = (data: AuthoritySchema[]) => ({ type: T.INIT_MENU_LIST, data }) // 初始化菜单列表
export const modifyWindowId = (data: { id: string, newId: string }) => ({ type: T.MODIFY_WINDOW_ID, data }) // 修改窗口id
export const clearWindow = (data: boolean = false) => ({ type: T.CLEARWINDOW, data }) // 清空窗口